Optimal. Leaf size=38 \[ a x-b d \cos (c) \text {Ci}\left (\frac {d}{x}\right )+b x \sin \left (c+\frac {d}{x}\right )+b d \sin (c) \text {Si}\left (\frac {d}{x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3442, 3378,
3384, 3380, 3383} \begin {gather*} a x-b d \cos (c) \text {CosIntegral}\left (\frac {d}{x}\right )+b d \sin (c) \text {Si}\left (\frac {d}{x}\right )+b x \sin \left (c+\frac {d}{x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3378
Rule 3380
Rule 3383
Rule 3384
Rule 3442
Rubi steps
\begin {align*} \int \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx &=a x+b \int \sin \left (c+\frac {d}{x}\right ) \, dx\\ &=a x-b \text {Subst}\left (\int \frac {\sin (c+d x)}{x^2} \, dx,x,\frac {1}{x}\right )\\ &=a x+b x \sin \left (c+\frac {d}{x}\right )-(b d) \text {Subst}\left (\int \frac {\cos (c+d x)}{x} \, dx,x,\frac {1}{x}\right )\\ &=a x+b x \sin \left (c+\frac {d}{x}\right )-(b d \cos (c)) \text {Subst}\left (\int \frac {\cos (d x)}{x} \, dx,x,\frac {1}{x}\right )+(b d \sin (c)) \text {Subst}\left (\int \frac {\sin (d x)}{x} \, dx,x,\frac {1}{x}\right )\\ &=a x-b d \cos (c) \text {Ci}\left (\frac {d}{x}\right )+b x \sin \left (c+\frac {d}{x}\right )+b d \sin (c) \text {Si}\left (\frac {d}{x}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 50, normalized size = 1.32 \begin {gather*} a x+b x \cos \left (\frac {d}{x}\right ) \sin (c)+b x \cos (c) \sin \left (\frac {d}{x}\right )-b d \left (\cos (c) \text {Ci}\left (\frac {d}{x}\right )-\sin (c) \text {Si}\left (\frac {d}{x}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 43, normalized size = 1.13
method | result | size |
default | \(a x -b d \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x}{d}-\sinIntegral \left (\frac {d}{x}\right ) \sin \left (c \right )+\cosineIntegral \left (\frac {d}{x}\right ) \cos \left (c \right )\right )\) | \(43\) |
derivativedivides | \(-d \left (-\frac {a x}{d}+b \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x}{d}-\sinIntegral \left (\frac {d}{x}\right ) \sin \left (c \right )+\cosineIntegral \left (\frac {d}{x}\right ) \cos \left (c \right )\right )\right )\) | \(48\) |
risch | \(a x -\frac {i {\mathrm e}^{-i c} \pi \,\mathrm {csgn}\left (\frac {d}{x}\right ) b d}{2}+i {\mathrm e}^{-i c} \sinIntegral \left (\frac {d}{x}\right ) b d +\frac {\expIntegral \left (1, -\frac {i d}{x}\right ) {\mathrm e}^{-i c} b d}{2}+\frac {{\mathrm e}^{i c} \expIntegral \left (1, -\frac {i d}{x}\right ) b d}{2}+b x \sin \left (\frac {c x +d}{x}\right )\) | \(87\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.32, size = 65, normalized size = 1.71 \begin {gather*} -\frac {1}{2} \, {\left ({\left ({\left ({\rm Ei}\left (\frac {i \, d}{x}\right ) + {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \cos \left (c\right ) - {\left (-i \, {\rm Ei}\left (\frac {i \, d}{x}\right ) + i \, {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \sin \left (c\right )\right )} d - 2 \, x \sin \left (\frac {c x + d}{x}\right )\right )} b + a x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 52, normalized size = 1.37 \begin {gather*} b d \sin \left (c\right ) \operatorname {Si}\left (\frac {d}{x}\right ) + b x \sin \left (\frac {c x + d}{x}\right ) + a x - \frac {1}{2} \, {\left (b d \operatorname {Ci}\left (\frac {d}{x}\right ) + b d \operatorname {Ci}\left (-\frac {d}{x}\right )\right )} \cos \left (c\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + \frac {d}{x} \right )}\right )\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 137 vs.
\(2 (38) = 76\).
time = 4.06, size = 137, normalized size = 3.61 \begin {gather*} a x - \frac {{\left (c d^{2} \cos \left (c\right ) \operatorname {Ci}\left (-c + \frac {c x + d}{x}\right ) + c d^{2} \sin \left (c\right ) \operatorname {Si}\left (c - \frac {c x + d}{x}\right ) - \frac {{\left (c x + d\right )} d^{2} \cos \left (c\right ) \operatorname {Ci}\left (-c + \frac {c x + d}{x}\right )}{x} - \frac {{\left (c x + d\right )} d^{2} \sin \left (c\right ) \operatorname {Si}\left (c - \frac {c x + d}{x}\right )}{x} + d^{2} \sin \left (\frac {c x + d}{x}\right )\right )} b}{{\left (c - \frac {c x + d}{x}\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int a+b\,\sin \left (c+\frac {d}{x}\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________